package book;

public class BookList {
    //书都是同一类型的元素，创建一个Book类型的数组
    private Book[] books;
    private int size;
    //先给书架放三本书
    public BookList() {
        this.books = new Book[100];
        books[0] = new Book("狂人日记","鲁迅",10,"小说",1);
        books[1] = new Book("将进酒","李白",23,"诗",3);
        books[2] = new Book("清明上河图","张择端",20,"书法",2);
        this.size = 3;
    }
    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public void setBooks(int pos, Book book) {
        this.books[pos] = book;
    }

    public Book getBook(int pos) {
        return this.books[pos];
    }
}